package app

import (
	"hft/Http/Services/front/app/app_res"
	utils "hft/Http/Utils"
	"hft/e"
	"strconv"

	"github.com/gin-gonic/gin"
)

type Base struct{}

// 底部
func (*Base) GetBottom(c *gin.Context) {
	city, _ := strconv.Atoi(c.Request.Header.Get("sid"))
	if city == 0 {
		utils.FailWithMessage(e.NoManagerHere, c)
		return
	}
	if data, err := app_res.ApplicationService.GetBottom(city); err != nil {
		utils.FailWithMessage(err.Error(), c)
		return
	} else {
		utils.OkWithData(data, c)
	}

}

var BaseController = new(Base)
